part of 'header.dart';

class HeaderMenuView extends StatelessWidget {
  const HeaderMenuView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final controller = Get.find<HomeController>();
    return Container(
      padding: EdgeInsets.only(top: 25.w, bottom: 10.w),
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.vertical(top: Radius.circular(25.w))),
      child: Wrap(
        runSpacing: 10.w,
        children: controller.state.menu
            .asMap()
            .map((key, value) {
              return MapEntry(
                  key,
                  MenuItemView(
                      onTap: () => controller.actionApp(key),
                      width: Get.width / 5,
                      icon: loadImage(
                          url: value.icon.imgPathHome,
                          height: 25.w,
                          width: 25.w,
                          fit: BoxFit.contain),
                      title: Text(
                        value.name,
                        style: pfMediumStyle(
                            color: ColorsUtil.title, fontSize: font15),
                      )));
            })
            .values
            .toList(),
      ),
    );
  }
}
